<%--
  Created by IntelliJ IDEA.
  User: 杨娇
  Date: 2025/6/23
  Time: 10:04
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>绿能充 - 用户注册</title>
    <link href="https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
    <style>
        :root {
            --primary-color: #00a896;
            --secondary-color: #02c39a;
            --admin-color: #d64550;
            --tester-color: #f39c12;
            --user-color: #3498db;
            --dark-color: #05668d;
            --light-color: #f0f3bd;
            --text-dark: #333;
            --text-light: #f8f9fa;
            --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
            --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Noto Sans SC', sans-serif;
            color: var(--text-dark);
            background-color: #f9f9f9;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            padding: 20px;
        }

        .auth-page {
            width: 100%;
            max-width: 450px;
        }

        .auth-container {
            width: 100%;
            padding: 50px 40px;
            background-color: white;
            border-radius: 15px;
            box-shadow: var(--shadow);
            position: relative;
            overflow: hidden;
        }

        .auth-container::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 5px;
            background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
        }

        .auth-logo {
            width: 70px;
            height: 70px;
            margin: 0 auto 20px;
            background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
            border-radius: 50%;
            display: flex;
            justify-content: center;
            align-items: center;
            color: white;
            font-size: 28px;
            box-shadow: 0 5px 15px rgba(0, 168, 150, 0.3);
        }

        .auth-header {
            text-align: center;
            margin-bottom: 40px;
        }

        .auth-header h2 {
            color: var(--dark-color);
            margin-bottom: 10px;
            font-size: 2rem;
        }

        .auth-header p {
            color: #777;
            font-size: 0.95rem;
        }

        .form-group {
            margin-bottom: 25px;
            position: relative;
        }

        .form-group label {
            display: block;
            margin-bottom: 8px;
            font-weight: 500;
            color: #555;
            font-size: 0.95rem;
        }

        .form-group input {
            width: 100%;
            padding: 14px 15px 14px 45px;
            border: 1px solid #ddd;
            border-radius: 8px;
            font-size: 15px;
            transition: var(--transition);
            background-color: #fafafa;
        }

        .form-group input:focus {
            border-color: var(--primary-color);
            outline: none;
            box-shadow: 0 0 0 3px rgba(0, 168, 150, 0.1);
            background-color: white;
        }

        .input-icon {
            position: absolute;
            left: 15px;
            top: 40px;
            color: #999;
            font-size: 18px;
        }

        .auth-btn {
            width: 100%;
            padding: 14px;
            background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 16px;
            font-weight: 500;
            cursor: pointer;
            transition: var(--transition);
            margin-top: 10px;
            box-shadow: 0 4px 15px rgba(0, 168, 150, 0.3);
        }

        .auth-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 20px rgba(0, 168, 150, 0.4);
        }

        .switch-auth {
            text-align: center;
            margin-top: 25px;
            font-size: 0.95rem;
            color: #777;
        }

        .switch-auth a {
            color: var(--primary-color);
            text-decoration: none;
            font-weight: 500;
            margin-left: 5px;
            transition: var(--transition);
        }

        .switch-auth a:hover {
            color: var(--dark-color);
            text-decoration: underline;
        }

        .social-auth {
            margin-top: 30px;
            text-align: center;
        }

        .social-auth p {
            color: #999;
            font-size: 14px;
            margin-bottom: 15px;
            position: relative;
        }

        .social-auth p::before,
        .social-auth p::after {
            content: '';
            position: absolute;
            top: 50%;
            width: 30%;
            height: 1px;
            background-color: #eee;
        }

        .social-auth p::before {
            left: 0;
        }

        .social-auth p::after {
            right: 0;
        }

        .social-icons {
            display: flex;
            justify-content: center;
            gap: 15px;
        }

        .social-icon {
            width: 45px;
            height: 45px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 18px;
            cursor: pointer;
            transition: var(--transition);
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        }

        .social-icon:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
        }

        .icon-google {
            background-color: #db4437;
        }

        .icon-wechat {
            background-color: #07C160;
        }

        .icon-alipay {
            background-color: #00A0E9;
        }

        /* 密码强度指示器 */
        .password-strength {
            margin-top: 5px;
            height: 5px;
            background-color: #eee;
            border-radius: 5px;
            overflow: hidden;
        }

        .strength-meter {
            height: 100%;
            width: 0;
            transition: width 0.3s ease;
        }

        /* 响应式设计 */
        @media (max-width: 576px) {
            .auth-container {
                padding: 40px 25px;
            }
        }
    </style>
</head>
<body>
<!-- 注册页面 -->
<div class="auth-page" id="registerPage">
    <div class="auth-container">
        <div class="auth-logo">
            <i class="fas fa-user-plus"></i>
        </div>
        <div class="auth-header">
            <h2>绿能充注册</h2>
            <p>创建账户以使用我们的充电服务</p>
        </div>
        <form id="registerForm" action="/user/register" method="post">
            <div class="form-group">
                <label for="regUsername">用户名</label>
                <i class="fas fa-user input-icon"></i>
                <input type="text" id="regUsername" name="username" placeholder="请输入用户名" required>
            </div>
            <div class="form-group">
                <label for="regEmail">电子邮箱</label>
                <i class="fas fa-envelope input-icon"></i>
                <input type="email" id="regEmail" name="email" placeholder="请输入电子邮箱" required>
            </div>
            <div class="form-group">
                <label for="regPhone">手机号码</label>
                <i class="fas fa-mobile-alt input-icon"></i>
                <input type="tel" id="regPhone" name="phone" placeholder="请输入手机号码" required>
            </div>
            <div class="form-group">
                <label for="regPassword">密码</label>
                <i class="fas fa-lock input-icon"></i>
                <input type="text" id="regPassword" name="password" placeholder="请输入密码" required>
            </div>
            <div class="form-group">
                <label for="regConfirmPassword">确认密码</label>
                <i class="fas fa-lock input-icon"></i>
                <input type="text" id="regConfirmPassword" placeholder="请再次输入密码" required>
            </div>
            <button type="submit" class="auth-btn">注册</button>
        </form>

        <div class="switch-auth">
            <span>已有账号?</span>
            <a href="/user/login" id="toLogin">立即登录</a>
        </div>

        <div class="social-auth">
            <p>快速注册</p>
            <div class="social-icons">
                <div class="social-icon icon-wechat">
                    <i class="fab fa-weixin"></i>
                </div>
                <div class="social-icon icon-alipay">
                    <i class="fab fa-alipay"></i>
                </div>
                <div class="social-icon icon-google">
                    <i class="fab fa-google"></i>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    // 表单验证（仅保留密码一致性检查）
    document.getElementById('registerForm').addEventListener('submit', function(e) {
        const password = document.getElementById('regPassword').value;
        const confirmPassword = document.getElementById('regConfirmPassword').value;

        if (password !== confirmPassword) {
            e.preventDefault();
            alert('两次输入的密码不一致');
            return false;
        }

        return true;
    });
</script>
</body>
</html>
